package com.lungle.warmdiary.app.model.response;

import com.lungle.warmdiary.app.AppException;
import com.lungle.warmdiary.app.model.Entity;

import java.io.IOException;
import java.io.InputStream;
import java.util.Date;
import java.util.Random;

/**
 * 消息通知
 */
public class Message extends Entity {
    public static final int STATE_READ = 1;
    public static final int STATE_NEW = 0;

    public static final int TYPE_SYSTEM = 1;
    public static final int TYPE_MANUAL = 2;
    public static final int CATEGORY_ACTIVE = 2;
    public static final int CATEGORY_SYSTEM = 1;
    private String icon;
    private String title;
    private int type;
    private int category;
    private int status;
    private String createtime;
    private String content;
    private String link;

    public static Message parse(InputStream is) throws IOException, AppException {
        Message message = new Message();
        message.setContent("第三轮多家私聊多家连锁");
        message.setCreatetime(new Date().toString());
        message.setTitle("title");
        message.setType(new Random().nextInt(2));
        message.setLink("http://www.baidu.com");

        return message;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public int getCategory() {
        return category;
    }

    public void setCategory(int category) {
        this.category = category;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getCreatetime() {
        return createtime;
    }

    public void setCreatetime(String createtime) {
        this.createtime = createtime;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    enum TYPE_MESSAGE {
        TYPE_SYSTEM,
        TYPE_MANUAL
    }


    enum category_message {
        CATEGORY_SYSTEM,
        CATEGORY_ACTIVE
    }

}